package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * 角色管理中，获取某角色对应某应用的模块权限清单 DTO
 * @author kaka
 * @time 2018-11-8 14:33
 */
@Getter
@Setter
@ToString
public class RoleModuleDetailDTO extends BaseDTO {

    private static final long serialVersionUID = 2773996427878027894L;

    /**
     * 角色id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @NotNull(message = "{dto.msg.roleModuleDetail.roleId.NotNull}")
    private Integer roleId;

    /**
     * saasMark为1 saas应用时，以此参数标示saas应用proPermissionId,saasMark为2 以此标示paas应用id
     */
    @NotNull(message = "{dto.msg.roleModuleDetail.appId.NotNull}")
    private Long appId;

    /**
     * 应用类型，1为saas应用，2为自建应用
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @NotNull(message = "{dto.msg.roleModuleDetail.saasMark.NotNull}")
    @Range(min = 1, max = 2, message = "{dto.msg.roleModuleDetail.saasMark.Range}")
    private Integer saasMark;
}
